package quick.api.app.service;

import com.alibaba.fastjson.JSONObject;
import quick.api.app.util.FormatObjectExt;
import webdm.business.bean.Context;
import webdm.business.bean.ResponseDTO;
import webdm.business.component.AbstractPipelineComponent;
import webdm.business.util.ValueUtil;

public class FormatExt extends AbstractPipelineComponent {

    @Override
    public ResponseDTO process(Context context) {

        Object value = ValueUtil.getValue(source, null, context.getParams());
        if (value != null && value instanceof JSONObject) {
            FormatObjectExt.format((JSONObject) value);
        }

        return ResponseDTO.getSuccessInstance();
    }
}
